let app = new Vue({
    el:'#preview',
    data:{
        motif_theme:'',
        preview:[],
        td:'',
        score:[],
        motifid:''
    }
});
$('body').on('click','.submit',function () {
    $.ajax({
        url: '/index.php?s=api/score/score_list',
        type:'POST',
        data:{
            score:app.score,
            motifid:app.motifid
        },
        success:function(value){
            console.log(value);
            if(value.status === 0){
                window.alert(value.message);
            }else{
                window.alert(value.message);
            }
        }
    });
});
$(document).ready(function(){
    $.ajax({
        url:'/index.php?s=api/preview/preview_list',
        type:'POST',
        data: {},
        success:function (value) {
            app.motif_theme = value.data[0];
            app.preview = value.data[1];
            app.motifid = value.data[2];
            console.log(value.data);
            console.log(app.motifid);
        }
    });
});
$('body').on('click','.edit',function(){
    $.ajax({
        url: '/index.php?s=api/edit/edit_list',
        type:'POST',
        data:{
        },
        success:function(value){
            window.location.href = '/index.php?s=index/login/login_list';
        }
    });
});